import 'package:ducafe_ui_core/ducafe_ui_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_styled_toast/flutter_styled_toast.dart';

import 'core/navigation/route_manager.dart';

void main() {
  runApp(ProviderScope(child: const XciteMainApplication()));
}

class XciteMainApplication extends ConsumerWidget {
  const XciteMainApplication({super.key});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    return ScreenUtilInit(
      designSize: const Size(414, 896),
      minTextAdapt: true,
      splitScreenMode: true,
      child: StyledToast(
        locale: const Locale('zh', 'CN'),
        child: MaterialApp.router(
          title: 'Xcite',
          themeMode: ThemeMode.system,
          routerConfig: RouteManager.router,
          debugShowCheckedModeBanner: false,
          theme: ThemeData(
            splashFactory: NoSplash.splashFactory,
            highlightColor: Colors.transparent,
            splashColor: Colors.transparent,
            materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
          ),
        ),
      ),
    );
  }
}
